class MathDojo 


  attr_reader :sum
  def initialize() 

    @sum = 0;

  end 

  def add(*rest)      
        rest.flatten!
        rest.each{|number| @sum += number}
        self
  end 

  def subtract(*rest)      
        rest.flatten!
        rest.each{|number| @sum -= number}
        self
  end 

end 



 puts MathDojo.new.add([1, 3], [4,5]).add([4]).subtract([1,6]).sum

